package cn.lg.soar.system.auth.model;

import cn.lg.soar.system.auth.entity.Org;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.Set;

/**
 * @author luguoxiang
 * @date 2021/9/11
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
public class OrgDto extends Org {

    private static final long serialVersionUID = -4449119630824641083L;

    @ApiModelProperty(value = "权限角色")
    private Set<Long> roleIds;

    public OrgDto() {
    }

    public OrgDto(Org org) {
        if (org == null) {
            return;
        }
        this.setId(org.getId());
        this.setType(org.getType());
        this.setName(org.getName());
        this.setAlias(org.getAlias());
        this.setRemark(org.getRemark());
        this.setDisabled(org.getDisabled());
    }

    public Org toOrg() {
        Org org = new Org();
        org.setId(this.getId());
        org.setType(this.getType());
        org.setName(this.getName());
        org.setAlias(this.getAlias());
        org.setRemark(this.getRemark());
        org.setDisabled(this.getDisabled());
        return org;
    }

}
